package com.sgcc.demo.controller;

import cn.com.headfree.base.controller.ResultData;
import com.sgcc.demo.service.IscQueryInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author demo
 */
@Controller
@RequestMapping(value = "/isc", produces = "application/json;charset=UTF-8")
public class IscController {
    private IscQueryInfo iscQueryInfo;

    public IscController(IscQueryInfo iscQueryInfo){
        this.iscQueryInfo=iscQueryInfo;
    }

    @RequestMapping(value="/getUserInfoByTicket/{ticket}",method= RequestMethod.GET)
    @ResponseBody
    public ResultData  getUserInfoByTicket(@PathVariable("ticket") String ticket){
        ResultData rs = new ResultData();
        try{
            System.out.println(ticket);
            String result=iscQueryInfo.getUserInfoByTicket(ticket);
            rs.setData(result);
        }catch (Exception e){
            //TODO
        }
        return rs;
    }

}
